package mypackage.servicce.Impl;

import mypackage.bean.Address;
import mypackage.dao.AddressDao;
import mypackage.dao.impl.AddressDaoImpl;
import mypackage.servicce.AddressService;

import java.util.List;

/**
 * @author YH925
 * @create 2021/12/9 22:15
 */
public class AddressServiceImpl implements AddressService {
    AddressDao dao = new AddressDaoImpl();
    @Override
    public List<Address> selectAddressList(int id) {
        return dao.selectAddressList(id);
    }

    @Override
    public Address selectAddressById(int addressId) {
        return dao.selectAddressById(addressId);
    }

    @Override
    public List<Address> selectAddressListWithClient(int clientId) {
        return dao.selectAddressListWithClient(clientId);
    }

    @Override
    public void insertAddress(int clientId, String acceptAddress, String tel, String acceptName) {
        dao.insertAddress(clientId,acceptAddress,tel,acceptName);
    }

    @Override
    public int findAddressAmount(int clientId) {
        return dao.findAddressAmount(clientId);
    }

    @Override
    public void updateInfo(int id, String newAddress, String newTel, String newName) {
        dao.updateInfo(id, newAddress, newTel, newName);
    }

    @Override
    public void delAddressById(int addressId) {
        dao.delAddressById(addressId);
    }
}
